on error resume next 'Uninstall All Version of Chrome '============================= Const HKEY_CURRENT_USER = &H80000001 Const HKEY_LOCAL_MACHINE = &H80000002 strComputer = "." Set WshShell = WScript.CreateObject("WScript.Shell") Set objReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & _ strComputer & "\root\default:StdRegProv") 'Get the OS architecture '======================= Err.Clear checkOSArch = WshShell.RegRead("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\PROCESSOR_ARCHITECTURE") returnValue = 0 'Wscript.Echo checkOSArch if Err Then Err.Clear 'WScript.Echo "The OS Architecture is unable to find ,so it was assumed to be 32 bit" else if checkOSArch = "x86" Then 'Wscript.Echo "The OS Architecture is 32 bit" strKeyPath = "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall" returnValue = RemoveChrome (strKeyPath) else 'Wscript.Echo "The OS Architecture is 64 bit" strKeyPath64 = "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall" returnValue = RemoveChrome (strKeyPath64) strKeyPath86 = "SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall" returnValue = RemoveChrome (strKeyPath86) End IF End If Wscript.Quit returnValue '=============================================================== 'Script to Iterate the Uninstall Resistry Key and remove the Java '=============================================================== Function RemoveChrome(KeyPath) On error resume next Set objReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & _ strComputer & "\root\default:StdRegProv") set shell = CreateObject("WScript.Shell") objReg.EnumKey HKEY_CURRENT_USER, KeyPath, arrSubKeys For Each Subkey in arrSubKeys str1 = "HKEY_CURRENT_USER\"&KeyPath &"\"&Subkey &"\DisplayName" str2 = WshShell.RegRead(str1) if InStr (str2,"Chrome") <> 0 then 'Wscript.Echo str1 str3 = "HKEY_CURRENT_USER\"&KeyPath &"\"&Subkey &"\UninstallString" uninstallStr = WshShell.RegRead(str3) 'Wscript.Echo uninstallStr if InStr (uninstallStr,"MsiExec") <> 0 then uninstallStr = uninstallStr & " /q /norestart" returnValue = WshShell.Run(uninstallStr,0,TRUE) 'Wscript.Echo uninstallStr & " " & returnValue Else returnValue = WshShell.Run(uninstallStr & " --force-uninstall",0,TRUE) End If End If Next End Function